package com.zaprk.config;

import com.zaprk.service.impl.UserServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Spring配置类
 */
@Configuration
public class SpringConfig {

    // 将当前方法的返回值作为bean注入到Spring容器当中,id为当前方法的名字
    @Bean
    public UserServiceImpl userService(){
        System.err.println("将UserServiceImpl对象添加到ioc容器");
        return new UserServiceImpl();
    }
}
